package org.triumphxx.springboot.async.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.triumphxx.springboot.async.service.AsyncErrService;

import javax.annotation.Resource;

/**
 * @author:triumphxx
 * @Date: 2023/12/9
 * @Time: 16:50
 * @微信公众号：思考集结处
 * @网站：http://blog.triumphxx.com.cn
 * @GitHub https://github.com/triumphxx
 * @Desc: 测试高并发下@Async注解实现的线程异常调度问题
 **/

@RestController
@Slf4j
public class AsyncErrController {

    @Resource
    AsyncErrService asyncErrService;

    @PostMapping("/sync")
    public String testAsync() {
        log.info("开始方法执行：{}",Thread.currentThread().getName());
       return asyncErrService.async();
    }
}
